package com.hushao.lims.weblims.service;

import com.hushao.lims.weblims.domain.EquipmentInfo;
import com.hushao.lims.weblims.domain.EquipmentScrap;
import com.hushao.lims.weblims.domain.TeacherInfo;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

/**
 * @author 930588706
 * @date 18/1/22
 * 器材报废
 */
public interface EquipmentScrapService {
    /**
     * 器材报废
     * @param equipmentInfo
     * @param equipmentCount
     * @param teacherInfo
     * @return
     * @throws Exception
     */
    EquipmentScrap applyScrapped(EquipmentInfo equipmentInfo, Integer equipmentCount, TeacherInfo teacherInfo)throws Exception;

    /**
     * 根据器材名称模糊查询个人申请报废列表（分页）
     * @param equipmentName
     * @param teacher
     * @param pageable
     * @return
     */
    Page<EquipmentScrap> listEquipmentScrappedByTeacherAndEquipmentName(String equipmentName, TeacherInfo teacher, Pageable pageable);


    /**
     * 撤销个人器材报废申请
     * @param equipmentScrappedId
     * @throws Exception
     */
    void remove(Long equipmentScrappedId) throws Exception;

    /**
     * 根据器材名称，状态模糊查询报废表
     * @param equipmentName
     * @param state
     * @param pageable
     * @return
     */
    Page<EquipmentScrap> listEquipmentScrappedByEquipmentNameLikeAndStateLike(String equipmentName, String state, Pageable pageable);

    /**
     * 审核器材报废
     * @param equipmentScrapId
     * @param state
     * @param teacher
     * @return
     * @throws Exception
     */
    EquipmentScrap audit(Long equipmentScrapId, String state, TeacherInfo teacher)throws Exception;
}
